package io.kiki.stack.netty.userProcessor;

import io.kiki.stack.netty.processor.AsyncContext;
import io.kiki.stack.netty.processor.BizContext;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * Extends this to process user defined request in ASYNC way.<br>
 * If you want process request in SYNC way, please extends {@link SyncUserProcessor}.
 */

@Slf4j
@Setter
@Getter
public abstract class AsyncUserProcessor<T> extends AbstractUserProcessor<T> {
    /**
     * unsupported here!
     */
    @Override
    public Object syncHandleRequest(BizContext bizContext, T request) throws Exception {
        throw new UnsupportedOperationException("SYNC handle request is unsupported in AsyncUserProcessor!");
    }


    @Override
    public abstract void asyncHandleRequest(BizContext bizContext, AsyncContext asyncContext, T request);


    @Override
    public abstract String interest();
}
